"""
约瑟夫环问题
”“”


def main():
    persons=[True]*30
    idx,num,counter=0,0,0
    while counter<15:
        if persons[idx]:
            num+=1
            if num==9:
                persons[idx]=False
                counter+=1
                num=0
        idx==1
        idx%=30
    for pos,person in enumerate(persons):
        print(pos,'基' if person else '非')


if __name__=='__main__':
    main()

